# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-orionsdk
pkgname=('python2-orionsdk' 'python-orionsdk')
_pkgname=orionsdk
pkgver=0.4.0
pkgrel=2
pkgdesc='Nanosecond resolution temporal types.'
arch=('any')
url='https://pypi.org/project/orionsdk/#files'
license=('APACHE')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('44965fbbff779329eb7585c19071d5e0194cda016303a3a15d047f95dbe630cf275fecf022905d92c6fdad40869eaec4daf222f525548fe073b55340e05e52e6')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-orionsdk() {
  depends=('python2' 'python2-requests' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-orionsdk() {
  depends=('python' 'python-requests' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

